<?php


/*
* Copyright (c) 2008-2016 vip.com, All Rights Reserved.
*
* Powered by com.vip.osp.osp-idlc-2.5.11.
*
*/

namespace com\vip\osp\act\ug\service;

class PreCheckActivityRequest {
	
	static $_TSPEC;
	public $precheck_act_id = null;
	public $channel_id = null;
	public $encrypt_mobile = null;
	public $ip = null;
	public $vop_check = null;
	public $seq_id = null;
	
	public function __construct($vals=null){
		
		if (!isset(self::$_TSPEC)){
			
			self::$_TSPEC = array(
			1 => array(
			'var' => 'precheck_act_id'
			),
			2 => array(
			'var' => 'channel_id'
			),
			3 => array(
			'var' => 'encrypt_mobile'
			),
			4 => array(
			'var' => 'ip'
			),
			5 => array(
			'var' => 'vop_check'
			),
			6 => array(
			'var' => 'seq_id'
			),
			
			);
			
		}
		
		if (is_array($vals)){
			
			
			if (isset($vals['precheck_act_id'])){
				
				$this->precheck_act_id = $vals['precheck_act_id'];
			}
			
			
			if (isset($vals['channel_id'])){
				
				$this->channel_id = $vals['channel_id'];
			}
			
			
			if (isset($vals['encrypt_mobile'])){
				
				$this->encrypt_mobile = $vals['encrypt_mobile'];
			}
			
			
			if (isset($vals['ip'])){
				
				$this->ip = $vals['ip'];
			}
			
			
			if (isset($vals['vop_check'])){
				
				$this->vop_check = $vals['vop_check'];
			}
			
			
			if (isset($vals['seq_id'])){
				
				$this->seq_id = $vals['seq_id'];
			}
			
			
		}
		
	}
	
	
	public function getName(){
		
		return 'PreCheckActivityRequest';
	}
	
	public function read($input){
		
		$input->readStructBegin();
		while(true){
			
			$schemeField = $input->readFieldBegin();
			if ($schemeField == null) break;
			$needSkip = true;
			
			
			if ("precheck_act_id" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->precheck_act_id);
				
			}
			
			
			
			
			if ("channel_id" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->channel_id);
				
			}
			
			
			
			
			if ("encrypt_mobile" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->encrypt_mobile);
				
			}
			
			
			
			
			if ("ip" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->ip);
				
			}
			
			
			
			
			if ("vop_check" == $schemeField){
				
				$needSkip = false;
				$input->readBool($this->vop_check);
				
			}
			
			
			
			
			if ("seq_id" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->seq_id);
				
			}
			
			
			
			if($needSkip){
				
				\Osp\Protocol\ProtocolUtil::skip($input);
			}
			
			$input->readFieldEnd();
		}
		
		$input->readStructEnd();
		
		
		
	}
	
	public function write($output){
		
		$xfer = 0;
		$xfer += $output->writeStructBegin();
		
		$xfer += $output->writeFieldBegin('precheck_act_id');
		$xfer += $output->writeString($this->precheck_act_id);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldBegin('channel_id');
		$xfer += $output->writeString($this->channel_id);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldBegin('encrypt_mobile');
		$xfer += $output->writeString($this->encrypt_mobile);
		
		$xfer += $output->writeFieldEnd();
		
		if($this->ip !== null) {
			
			$xfer += $output->writeFieldBegin('ip');
			$xfer += $output->writeString($this->ip);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->vop_check !== null) {
			
			$xfer += $output->writeFieldBegin('vop_check');
			$xfer += $output->writeBool($this->vop_check);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		$xfer += $output->writeFieldBegin('seq_id');
		$xfer += $output->writeString($this->seq_id);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldStop();
		$xfer += $output->writeStructEnd();
		return $xfer;
	}
	
}

?>